Release 10.1A: OpenEdge Development:
Internationalizing Applications
Using collation tables
Each database has its own collation tables OpenEdge uses for index operations. The 4GL also uses collation tables for string comparisons. The collation tables specify the order in which characters sort. These tables are named
CASE-INSENSITIVE-SORTandCASE-SENSITIVE-SORT. TheCASE-INSENSITIVE-SORTtable sorts uppercase and lowercase letters identically. TheCASE-SENSITIVE-SORTtable distinguishes between uppercase and lowercase letters. To control how OpenEdge sorts characters, you can modify these tables. Each collation table consists of 256 cells (16 rows of 16 cells), each of which contains a decimal numeric value.For each character in a string, OpenEdge indexes the character’s numeric value from the collation table to a cell in one of these tables. For example, if a character has a numeric value of 233, OpenEdge goes to cell 233 in the table. After OpenEdge locates the appropriate cell, it reads the value in the cell to find the character’s sort weight. The sort weight tells OpenEdge where you want the character sorted relative to other characters in the code page. For example, a sort weight of 001 means that the character sorts first in an ascending sort.
Collation tables must exist for each code page. You can have more than one collation per code page. To find the correct collation table, OpenEdge uses the values of the
-cpinternaland-cpcollstartup parameters as keys to theconvmap.cpfile. The same collation name can appear for multiple code pages.The following rules determine how OpenEdge decides which collation table to use when performing comparisons or sorting:
- If you specify collation tables with the Collation Table (
-cpcoll) startup parameter, OpenEdge uses those collation tables.- If you name databases in the startup or connection command and do not use
-cpcoll, OpenEdge uses the collation table defined for the first database. If you connect to an additional database, OpenEdge uses the collation table of the additional database when working with the additional database.Note: The collation table you specify with the- If you do not name databases in the startup or connection command and do not use
-cpcoll, OpenEdge searchesconvmap.cpto find the collation table named BASIC for the internal code page.-cpcollstartup parameter must be in theDLC/convmap.cpfile, which is a binary file that contains tables for managing characters created by compiling theDLC/prolang/convmap/convmap.datfile. Ifconvmap.datdoes not have a collation table you need, you can create your own.4GL Comparisons
OpenEdge provides two types of character sorting. One type governs how data is stored within a database and affects index operations. Another type affects 4GL comparisons—comparisons that are performed by the 4GL and that do not impact indexes. For example, this is a typical 4GL comparison:
The character expressions can contain character strings, character variables, or character fields.
Database collation
A database has a collation table stored as part of its schema information. The collation table that is stored in the database does not affect how the OpenEdge client or server compares or sorts
CHARACTERdata (except for indexed data); it controls only how indexes are sorted and assigned. Similarly, a collation table specified by-cpcolldoes not affect the internal collation order that a database uses for its indexes.OpenEdge supplies collation tables for databases for many languages and locales. These are located in the
DLC/prolangsubdirectories. For languages that have one commonly used collation table, the table is contained in the_tran.dffile in the language subdirectory. If more than one collation table is common, each is contained in a data definition (.df) file named for the table’s corresponding code page. To change the collation table associated with a database, load the appropriate data definition file and rebuild your indexes.For more information on collations and collation tables, see Chapter 3, " Understanding Character Processing Tables." For information on using ICU collations as database collations, see Chapter 6, " Using Databases."
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |